Parse creatable_vgpu_types in the format the driver emits - #327
Closed
yummybomb wants to merge 1 commit into
Closed
Conversation
The driver prints an "ID : vGPU Name" table, so the previous name-then-ID parse rejected every line and no profiles were enumerated. A GPU with no framebuffer left prints only the header, which now yields zero profiles instead of an error.
Contributor
Author
|
Folded into #321 directly — the parser fix and its live validation are documented in that PR's description. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #321. Validated against an L40S host running vGPU Manager 580.159.01 on Ubuntu 24.04 / kernel 6.8, where the vendor VFIO framework is active and
/sys/class/mdev_bushas no parents.creatable_vgpu_typesis a table with a header row and the type ID first:The parser expected the name first and the ID last, so every line failed
strconv.Atoion the trailing word:listProfilespropagates that error,getVGPUStatusswallows it, and the host reports vGPU mode with 64 slots and zero profiles — so no vGPU placement can ever succeed.Parsing on the
:separator and skipping the header row fixes it. On the same host, profile enumeration now returns all 30 L40S types with correct framebuffer sizes.There is a second case worth locking in: once a profile consumes a GPU's entire framebuffer, the remaining VFs on that GPU print the header and nothing else. That is a legitimately empty list, not a malformed file, so it now yields zero profiles rather than an error — otherwise a single 48Q allocation would take the whole GPU's remaining capacity out of the status response.
Tests
go test ./lib/devices/...passes.